{{include file="public/header" /}}

{{include file="public/header_top_nav" /}}

{{include file="public/home_search" /}}



<link rel="stylesheet" href="{{$public_host}}static/web/css/style.css"></link>
<link rel="stylesheet" href="{{$public_host}}static/web/css/nav.css"></link>
<link rel="stylesheet" href="{{$public_host}}static/web/css/htmleaf-demo.css"></link>
<link rel="stylesheet" type="text/css" href="{{$public_host}}static/web/fonts/iconfont.css">
</link>

<div class="container mTop10" id="goodscategory">
  <div class="row">
    <div class="col-lg-12">
      <ol class="breadcrumb">
        <li><a href="{{$Think.__MY_URL__}}">Inicio</a></li>
        {{if !empty($category_info)}}
        <li><a href="{{:MyUrl('index/search/index', ['category_id'=>$category_info['id']])}}">{{$category_info.vice_name}}</a></li>
        {{/if}}
      </ol>
    </div>
  </div>
  <div class="search-container" data-category-id="{{if !empty($params['category_id'])}}{{$params.category_id}}{{/if}}">
    <div class="row inlineFlex">
      <div class="mTop10">
        {{include file="public/goods_category_special" /}}
      </div>
      <div class="mLeft20 mRight10 " style="flex: auto;width: 100%;">
        <!-- 排序方式 -->
        <div class="search-nav am-margin-top-sm">
          <ul class="sort-nav" data-am-sticky="{animation: 'slide-top'}">
            <!-- 搜索页面搜索导航条内前面钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
              <span>plugins_view_search_nav_inside_begin</span>
            </div>
            {{/if}}
            {{if !empty($plugins_view_search_nav_inside_begin_data) and is_array($plugins_view_search_nav_inside_begin_data)}}
            {{foreach $plugins_view_search_nav_inside_begin_data as $hook}}
            {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
            {{/if}}
            {{/foreach}}
            {{/if}}

            <li class="active" data-field="default" data-type="desc">
              <a href="javascript:;" title="Exhaustivo">
                <span>Exhaustivo</span>
              </a>
            </li>
            <li data-field="sales_count" data-type="desc">
              <a href="javascript:;" title="Ventas">
                <span>Ventas</span>
                <i class="am-icon-long-arrow-down"></i>
              </a>
            </li>
            <li data-field="access_count" data-type="desc">
              <a href="javascript:;" title="Atención">
                <span>Atención</span>
                <i class="am-icon-long-arrow-down"></i>
              </a>
            </li>
            <li data-field="min_price" data-type="desc">
              <a href="javascript:;" title="Precio">
                <span>Precio</span>
                <i class="am-icon-long-arrow-down"></i>
              </a>
            </li>
            <li data-field="id" data-type="desc">
              <a href="javascript:;" title="Actualizar">
                <span>Actualizar</span>
                <i class="am-icon-long-arrow-down"></i>
              </a>
            </li>

            <!-- 搜索页面排序导航条内尾部钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
              <span>plugins_view_search_nav_inside_end</span>
            </div>
            {{/if}}
            {{if !empty($plugins_view_search_nav_inside_end_data) and is_array($plugins_view_search_nav_inside_end_data)}}
            {{foreach $plugins_view_search_nav_inside_end_data as $hook}}
            {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
            {{/if}}
            {{/foreach}}
            {{/if}}
          </ul>
        </div>

        <!-- 搜索页面数据容器顶部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
        <div class="plugins-tag">
          <span>plugins_view_search_data_top</span>
        </div>
        {{/if}}
        {{if !empty($plugins_view_search_data_top_data) and is_array($plugins_view_search_data_top_data)}}
        {{foreach $plugins_view_search_data_top_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
        {{$hook|raw}}
        {{/if}}
        {{/foreach}}
        {{/if}}

        <!-- 数据容器 -->
        <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-5 am-margin-top-sm search-list"></ul>

        <!-- 搜索页面数据容器底部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
        <div class="plugins-tag">
          <span>plugins_view_search_data_bottom</span>
        </div>
        {{/if}}
        {{if !empty($plugins_view_search_data_bottom_data) and is_array($plugins_view_search_data_bottom_data)}}
        {{foreach $plugins_view_search_data_bottom_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
        {{$hook|raw}}
        {{/if}}
        {{/foreach}}
        {{/if}}

        <!-- 加载数据 -->
        <div class="loding-view">
          <i class="am-icon-spinner am-icon-pulse"></i>
          <span>carga...</span>
        </div>

        <!-- 没有数据 -->
        <div class="table-no" style="display:none;"><i class="am-icon-warning"></i>No mas datos</div>

        <!-- 分页 -->
        <button type="button" class="am-btn am-btn-default am-btn-block am-margin-vertical-sm search-pages-submit" data-url="{{:MyUrl('index/search/SpecialGoodsList')}}" style="display:none;">Cargar más <i class="am-icon-angle-double-down"></i></button>
      </div>

      <!-- 搜索页面顶部内部结构里面钩子 -->
      {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
      <div class="plugins-tag">
        <span>plugins_view_search_inside_bottom</span>
      </div>
      {{/if}}
      {{if !empty($plugins_view_search_inside_bottom_data) and is_array($plugins_view_search_inside_bottom_data)}}
      {{foreach $plugins_view_search_inside_bottom_data as $hook}}
      {{if is_string($hook) or is_int($hook)}}
      {{$hook|raw}}
      {{/if}}
      {{/foreach}}
      {{/if}}
    </div>
  </div>
</div>
</div>
</div>
{{include file="public/footer_nav" /}}

{{include file="public/footer" /}}
<script>
  function PoptitClose()
  {
    if($(window).width() < 1025)
    {
      $(document.body).css('position', 'static');
      $('.theme-signin-left').scrollTop(0);
      $('.theme-popover-mask').hide();
      $('.theme-popover').slideUp(100);
    }
  }

  $(document).on('click', '.favor-submit', function () {
    console.log(this.attr("data-id"));
  });

  function cart(opt,id){
    if(__user_id__ != 0)
    {

    }else{
      ModalLoad(__modal_login_url__, '', 'common-login-modal');
      return false;
    }
  }
  // 收藏
  function favor(opt,id,url){
    // 是否登录
    if(__user_id__ != 0)
    {
      // ajax请求
      $.AMUI.progress.start();
      $.ajax({
        url: url,
        type: 'post',
        dataType: "json",
        timeout: 10000,
        data: {"id": id},
        success: function(result)
        {
          $.AMUI.progress.done();
          PoptitClose();

          if(result.code == 0)
          {
            //这里更改收藏操作后的样式
            // $this.find('.goods-favor-text').text(result.data.text);
            // $this.find('.goods-favor-count').text('('+result.data.count+')');
            // if(result.data.status == 1)
            // {
            //     $this.addClass('text-active');
            // } else {
            //     $this.removeClass('text-active');
            // }
            Prompt(result.msg, 'success');
          } else {
            Prompt(result.msg);
          }
        },
        error: function(xhr, type)
        {
          $.AMUI.progress.done();
          PoptitClose();
          Prompt(HtmlToString(xhr.responseText) || '异常错误', null, 30);
        }
      });
    }else{
      ModalLoad(__modal_login_url__, '', 'common-login-modal');
      return false;
    }
  }
</script>